import java.time.*;
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
abstract class User implements Serializable{
    protected String userId;
    protected String username;
    protected String password;
    protected String phone;
    protected LocalDateTime registerTime;
    protected String userType;

    public User(String userId,String username,String password,String phone,String userType){
        this.userId=userId;
        this.username=username;
        this.password=password;
        this.phone=phone;
        this.registerTime=registerTime.now();
        this.userType=userType;
    }
    public abstract void showMenu(Logger logger,CinemaSystem system);
    public boolean login(String username,String password){
        return this.username.equals(username) && this.password.equals(password);
    }
    public void logout(){
        System.out.println("退出登录...");
    }
    public void changePassword(String newPassword,Logger logger){
        String oldPassword=this.password;
        this.password=newPassword;
        System.out.println("密码修改成功！");
        logger.logAction("修改密码",this.username);
    }
    public String getUserId(){return userId;}
    public String getUsername(){return username;}
    public String getPassword(){return password;}
    public String getPhone(){return phone;}
    public LocalDateTime getRegisterTime(){return registerTime;}
    public String getUserType(){return userType;}

    public void setPassword(String password){this.password=password;}
    public void setPhone(String phone){this.phone=phone;}
    public void setUserType(String userType){this.userType=userType;}
}